﻿using Domain.Entity.zct;
using Domain.IRepository;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography;
using System.Text;
using System.Threading.Tasks;

namespace Application.PermissionService
{
    public class PermissionService : IPermissionService
    {
        private readonly IPermissionRepository permissionRepository;

        public PermissionService(IPermissionRepository permissionRepository)
        {
            this.permissionRepository = permissionRepository;
        }

        public async Task<List<Permission>> GetAllPermissions()
        {
            return await permissionRepository.GetAllPermissions();
        }

        public async Task<List<EPermission>> GetAllPermissionTree()
        {
            return await permissionRepository.GetAllPermissionTree();
        }

        //根据角色编号显示菜单
        public async Task<List<EPermission>> GetMeau(int rid)
        {
            return await permissionRepository.GetMeau(rid);
        }
    }
}
